package net.liteheaven.xblib.common.ui;

import android.content.Context;
import android.widget.Toast;

public class SingleToast {
	
	private static final String TAG = "SingleToast";
	private static SingleToast mInst = null;	
	private Toast mToast;
	
	private static SingleToast getInst(){
		if (mInst == null){
			mInst = new SingleToast();
		}
		return mInst;
	}
	
	private SingleToast(){
	}
	
	public static void show(Context ctx, String text, int duration){
		SingleToast st = getInst();
		if (st.mToast != null){
			st.mToast.cancel();
		}
		st.mToast = Toast.makeText(ctx, text, duration);
		st.mToast.show();
	}
}
